package com.yyg.boot.web;

import lombok.extern.slf4j.Slf4j;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author 一一哥Sun
 * @Date Created in 2020/3/29
 * @Description 第二种实现Servlet的方式, 通过@WebServlet注解来实现注册.
 */
@Slf4j
@WebServlet(name = "OrderServlet", urlPatterns = "/order")
public class OrderServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        log.warn("第2种Servlet实现方式-->注解实现方式");
        resp.getWriter().write("success");
    }

}
